﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLNS_Public;
using System.Data;

namespace QLNS_Data
{
   public class ChucVu_Data
    {
       KetNoiCSDL_Data kn = new KetNoiCSDL_Data();

       public DataTable LayDuLieu()
       {
           return kn.LayDuLieu("Load_tbl_ChucVu");
       }
       public int update_ChucVu(ChucVu_Public maChucVu, ChucVu_Public tenChucVu)
       {
           int n = 2;
           string[]name=new string[n];
           object[] value = new object[n];
           name[0] = "@MaChucVu";
           value[0] = maChucVu.MaChucVu;
           name[1] = "@TenChucVu";
           value[1] = tenChucVu.TenChucVu;
           return kn.update("Update_ChucVu", name, value, n);
       }
       public int insert_ChucVu(ChucVu_Public tenChucVu)
       {
           int n = 1;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@TenChucVu";
           value[0] = tenChucVu.TenChucVu;
           return kn.update("Insert_ChucVu", name, value, n);
       }
       public int delete_ChucVu(ChucVu_Public maChucVu)
       {
           int n = 1;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@MaChucVu";
           value[0] = maChucVu.MaChucVu;
           return kn.update("Delete_ChucVu", name, value, n);
       }
    }
}
